import request from '@/utils/request'



/**
 * 获取所有工程师
 * @returns {AxiosPromise}
 */
export function getEngineer() {
  return request({
    url: '/engineer?page=1&limit=100',
    method: 'get',
  })

}
/**
 * 根据id查询工程师
 * @param id
 * @returns {AxiosPromise}
 */
export function getEngineerById(id) {
  return request({
    url: '/engineer/' + id,
    method: 'get',
  })

}

/**
 * 删除工程师
 * @param id 工程师id
 * @returns {AxiosPromise}
 */
export function deleteEngineerById(id) {
  return request({
    url: '/engineer/' + id,
    method: 'delete',
  })

}
/**
 * 更新工程师信息
 * @param engineer 工程师信息
 * @param id 工程师id
 * @returns {AxiosPromise}
 */
export function updateEngineer(id,engineer) {
  return request({
    url: '/engineer/' + id,
    method: 'put',
    params: engineer
  })

}/**
 * 添加工程师
 * @param engineer 工程师信息
 * @returns {AxiosPromise}
 */
export function addEngineer(engineer) {
  return request({
    url: '/engineer/create',
    method: 'get',
    params: engineer
  })

}
// {
//   job: engineer.job,
//     name: engineer.name,
//   number: engineer.number,
//   password: engineer.password,
//   phone: engineer.phone
// }
